<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" type="text/css" href="style.css" />

</head>

<body>
    <div id="app">
        <table class="pure-table">
            <thead>
                <tr>
                    <th>书籍名称</th>
                    <th>出版日期</th>
                    <th>价格</th>
                    <th>购买数量</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item,index) in books">
                    <td>{{item.name}}</td>
                    <td>{{item.date}}</td>
                    <td>{{item.price | getprice}}</td>
                    <td>
                        <button @click='priceDecert(index)' :disabled='item.count <= 1'>-</button>
                        {{item.count}}
                        <button @click='priceIncert(index)' :disabled='item.count >= 100'>+</button>
                    </td>
                    <td>
                        <button @click='removeBook(index)'>移除</button>
                    </td>
                </tr>
            </tbody>
        </table>
        <span>总价：{{totalPrice}}</span>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="main.js"></script>
</body>

</html>